﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text;
using System.Data.SqlClient;
using EmoneyWeiXinCommon;
namespace EmoneyWeiXinDAL
{
    public class ZTHotsRecordDAL
    {
        public static void AddOneRecord(string ztCode)
        {
            string sql = @"if exists(SELECT 1 from ZTHotsRecord where ZTCode=@ztCode)
                           begin
                           update ZTHotsRecord set clickCount=clickCount+1 where ZTCode=@ztCode
                           end
                           else
                           begin
                           INSERT INTO ZTHotsRecord VALUES (@ztCode,1,GETDATE())
                           end";
            SqlParameter[] paras = 
            {
             new SqlParameter("@ztCode",ztCode)
            };
            SQLHelper.ExecuteNonQuery(Config.EmoneyWeiXin, System.Data.CommandType.Text, sql, paras);
        }

    }
}
